package com.wing.product.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wing.mybatis.common.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 委外订单-产品
 *
 * @author
 */
@EqualsAndHashCode(callSuper = true)
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("pro_outsourcing_order_product")
public class ProOutsourcingOrderProduct extends BaseEntity<ProOutsourcingOrderProduct> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 产品名称
     */
    private String skuName;

    /**
     * 产品编号
     */
    private String skuCode;

    /**
     * 所属委外订单id
     */
    private Long orderId;

    /**
     * 含税单价
     */
    private BigDecimal currentCostPrice;

    /**
     * 关联内部产品id
     */
    private Long productDetailId;

    /**
     * 税额
     */
    private BigDecimal tax;

    /**
     * 含税总金额
     */
    private String taxTotalPrice;

    /**
     * 税率
     */
    private Long taxRate;

    /**
     * 总金额(单价 × 数量)
     */
    private BigDecimal totalPrice;

    /**
     * 生产单位id
     */
    private String unitName;

    /**
     * 仓库id
     */
    private Long warehouseId;

    /**
     * 是否需要检验
     */
    private Boolean isChecked;

    /**
     * 库存数量(当时库存数量)
     */
    private BigDecimal warehouseQuantity;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 产品-物料详情
     */
    @TableField(exist = false)
    private List<ProOutsourcingOrderProductDetail> productDetails;

}
